From 2be705477d5cddfd2dac2314cddebbb6aff841d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 11 Sep 2005 10:46:59 +0000 Subject: [PATCH] removed unused list of conversions to foo --- ChangeLog | 15 ++++++++++++ babl/babl-classes.h | 4 ---- babl/babl-conversion.c | 1 - babl/babl-format.c | 2 -- babl/babl-image.c | 6 ++--- babl/babl-introspect.c | 12 ---------- babl/babl-memory.c | 2 +- babl/babl-model.c | 2 -- babl/babl-sampling.c | 1 - babl/babl-sanity.c | 52 ------------------------------------------ babl/babl-type.c | 2 -- 11 files changed, 19 insertions(+), 80 deletions(-) diff --git a/ChangeLog b/ChangeLog index d24b9ff..e082475 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-09-11 Øyvind Kolås + + * babl/babl-classes.h: Removed unused list of conversions to + types/models/formats. + + * babl/babl-conversion.c: (conversion_new): + * babl/babl-format.c: (each_babl_format_destroy), (format_new): + * babl/babl-image.c: (babl_image_from_linear): + * babl/babl-introspect.c: (item_conversions_introspect): + * babl/babl-memory.c: (babl_realloc): + * babl/babl-model.c: (each_babl_model_destroy), (model_new): + * babl/babl-sampling.c: (each_babl_sampling_destroy): + * babl/babl-sanity.c: (type_sanity), (model_sanity), (babl_sanity): + * babl/babl-type.c: (each_babl_type_destroy), (type_new): + 2005-09-09 Øyvind Kolås * docs/Makefile.am: set BABL_PATH to builddir for creating the diff --git a/babl/babl-classes.h b/babl/babl-classes.h index 6e340bf..7bdd4f9 100644 --- a/babl/babl-classes.h +++ b/babl/babl-classes.h @@ -123,7 +123,6 @@ typedef struct { BablInstance instance; BablConversion **from; /*< NULL terminated list of conversions from class */ - BablConversion **to; /*< NULL terminated list of conversions to class */ int bits; /*< number of bits used to represent the data type (initially restricted to a multiple of 8) */ double min_val; @@ -151,7 +150,6 @@ typedef struct { BablInstance instance; BablConversion **from; /*< NULL terminated list of conversions from class */ - BablConversion **to; /*< NULL terminated list of conversions to class */ int horizontal; int vertical; char name[4]; @@ -170,7 +168,6 @@ typedef struct { BablInstance instance; BablConversion **from; /*< NULL terminated list of conversions from class */ - BablConversion **to; /*< NULL terminated list of conversions to class */ int components; BablComponent **component; BablType **type; /*< must be doubles, used here for convenience in code */ @@ -180,7 +177,6 @@ typedef struct { BablInstance instance; BablConversion **from; /*< NULL terminated list of conversions from class */ - BablConversion **to; /*< NULL terminated list of conversions to class */ int components; BablComponent **component; BablType **type; diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c index 7d419ef..d308469 100644 --- a/babl/babl-conversion.c +++ b/babl/babl-conversion.c @@ -96,7 +96,6 @@ conversion_new (const char *name, babl->conversion.processings = 0; babl_add_ptr_to_list ((void ***)&(source->type.from), babl); - babl_add_ptr_to_list ((void ***)&(destination->type.to), babl); return babl; } diff --git a/babl/babl-format.c b/babl/babl-format.c index 56ad171..45ffcf0 100644 --- a/babl/babl-format.c +++ b/babl/babl-format.c @@ -28,7 +28,6 @@ each_babl_format_destroy (Babl *babl, void *data) { babl_free (babl->format.from); - babl_free (babl->format.to); babl_free (babl); return 0; /* continue iterating */ @@ -75,7 +74,6 @@ format_new (const char *name, sizeof (int) * (components)); babl->format.from = NULL; - babl->format.to = NULL; babl->format.component = ((void *)babl) + sizeof (BablFormat); babl->format.type = ((void *)babl->format.component) + sizeof (BablComponent*) * (components); babl->format.sampling = ((void *)babl->format.type) + sizeof (BablType*) * (components); diff --git a/babl/babl-image.c b/babl/babl-image.c index 8535554..a8ecc6e 100644 --- a/babl/babl-image.c +++ b/babl/babl-image.c @@ -68,11 +68,11 @@ image_new (BablFormat *format, Babl * babl_image_from_linear (void *buffer, - Babl *format) + Babl *format) { Babl *babl; - BablModel *model; - int components; + BablModel *model = NULL; + int components = 0; int i; BablComponent *component [BABL_MAX_COMPONENTS]; BablSampling *sampling [BABL_MAX_COMPONENTS]; diff --git a/babl/babl-introspect.c b/babl/babl-introspect.c index d440bc4..685dbf1 100644 --- a/babl/babl-introspect.c +++ b/babl/babl-introspect.c @@ -111,18 +111,6 @@ item_conversions_introspect (Babl *babl) ptr++; } - if (babl->type.to) - babl_log ("\t\tconversions to %s: %i", - babl->instance.name, list_length ((void **)(babl->type.to))); - - - ptr = (void **)babl->type.to; - - while (ptr && NULL!=*ptr) - { - babl_log ("\t\t\t'%s'", ((Babl *)(*ptr))->instance.name); - ptr++; - } } static void diff --git a/babl/babl-memory.c b/babl/babl-memory.c index 13e518c..b152f85 100644 --- a/babl/babl-memory.c +++ b/babl/babl-memory.c @@ -151,7 +151,7 @@ void * babl_realloc (void *ptr, size_t size) { - void *ret; + void *ret = NULL; if (!ptr) { diff --git a/babl/babl-model.c b/babl/babl-model.c index 0b5faaa..d3fa478 100644 --- a/babl/babl-model.c +++ b/babl/babl-model.c @@ -28,7 +28,6 @@ each_babl_model_destroy (Babl *babl, void *data) { babl_free (babl->model.from); - babl_free (babl->model.to); babl_free (babl); return 0; /* continue iterating */ } @@ -73,7 +72,6 @@ model_new (const char *name, memcpy (babl->model.component, component, sizeof (BablComponent*)*components); babl->model.from = NULL; - babl->model.to = NULL; return babl; } diff --git a/babl/babl-sampling.c b/babl/babl-sampling.c index 13832df..125da99 100644 --- a/babl/babl-sampling.c +++ b/babl/babl-sampling.c @@ -48,7 +48,6 @@ each_babl_sampling_destroy (Babl *babl, void *data) { babl_free (babl->sampling.from); - babl_free (babl->sampling.to); return 0; /* continue iterating */ } diff --git a/babl/babl-sanity.c b/babl/babl-sanity.c index bb84b0c..4f7c33e 100644 --- a/babl/babl-sanity.c +++ b/babl/babl-sanity.c @@ -29,7 +29,6 @@ foo (Babl *babl, return 0; } -static Babl *babl_conversion_source (Babl *babl); static Babl *babl_conversion_destination (Babl *babl); static int @@ -63,29 +62,6 @@ type_sanity (Babl *babl, babl->instance.name); } - - ok = 0; - if (babl->type.to) - { - ptr = (void **) babl->type.to; - - while (ptr && NULL!=*ptr) - { - if (babl_conversion_source ((Babl *)(*ptr)) == babl_type_id (BABL_DOUBLE)) - { - ok = 1; - break; - } - ptr++; - } - } - if (!ok) - { - OK=0; - babl_log ("lack of sanity! type '%s' has no conversion from double", - babl->instance.name); - } - return 0; } @@ -121,29 +97,6 @@ model_sanity (Babl *babl, babl->instance.name); } - - ok = 0; - if (babl->model.to) - { - ptr = (void **) babl->model.to; - - while (ptr && NULL!=*ptr) - { - if (babl_conversion_source ((Babl *)(*ptr)) == babl_model_id (BABL_RGBA)) - { - ok = 1; - break; - } - ptr++; - } - } - if (!ok) - { - babl_log ("lack of sanity! model '%s' has no conversion from 'rgba'", - babl->instance.name); - OK=0; - } - return 0; } @@ -182,11 +135,6 @@ babl_sanity (void) return OK; } -static Babl *babl_conversion_source (Babl *babl) -{ - return (Babl *)babl->conversion.source; -} - static Babl *babl_conversion_destination (Babl *babl) { return (Babl *)babl->conversion.destination; diff --git a/babl/babl-type.c b/babl/babl-type.c index d08a4f3..9edeeee 100644 --- a/babl/babl-type.c +++ b/babl/babl-type.c @@ -29,7 +29,6 @@ each_babl_type_destroy (Babl *babl, void *data) { babl_free (babl->type.from); - babl_free (babl->type.to); babl_free (babl); return 0; /* continue iterating */ } @@ -52,7 +51,6 @@ type_new (const char *name, strcpy (babl->instance.name, name); babl->type.bits = bits; babl->type.from = NULL; - babl->type.to = NULL; return babl; } -- 2.30.2